package cn.cycleif.config;

import io.minio.MinioClient;
import cn.cycleif.properties.MinioProp;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Date: 2024/9/14-15:27
 * @Desc:
 */
@Configuration
public class MinioCfg {

  @Bean
  public MinioClient minioClient(MinioProp minioProp) {
    return MinioClient.builder()
                      .endpoint(minioProp.getUrl())
                      .credentials(minioProp.getUsername(), minioProp.getPassword())
                      .build();
  }
}
